Time to write your first scene. Use the prototype you wrote earlier as a guide.

  • Choose your background and sprites.
  • Change the strings in the .say() commands to present a new problem for the player to solve.
  • Change the string in the .ask() command to have the sprite give the player new choices.
  • Change the feedback in .set_text() to give the player feedback based on their choice.

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("schoolhallway") sprite = codesters.Sprite("person10", -125, -100) emma = codesters.Sprite("person8", 0, -125) points = 0 # first scene emma.say("Someone took my phone!") stage.wait(3) emma.say("They've been sending people mean texts, and people think I sent them!") stage.wait(3) sprite.say("What should I do?") choice = sprite.ask("a)Tell a trusted adult b)Tell people Tanya is sending the messages c)Ignore Tanya") # text = codesters.Text("text", x, y) text = codesters.Text("Hello up here.", 0, 200) if choice == "a": text.set_text("Great choice!") if choice == "b": text.set_text("It's not very nice to spread rumors!") if choice == "c": text.set_text("Don't be a bystander, stand up to bullying!") emma.move_right(500) # second scene mike = codesters.Sprite("person12") mike.go_to(0, -125) mike.say("Someone has been harassing me online!") stage.wait(3) mike.say("I think my friend Tom might be doing it.") stage.wait(3) sprite.say("What should I do?") choice = sprite.ask("a)Laugh at Mike b)Sympathize with Mike c)Harass Tom") if choice == "a": text.set_text("Think how that makes Mike feel!") if choice == "b": text.set_text("Great job!") if choice == "c": text.set_text("Don't fight harassment by harassing someone else!")
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)